package com.aaa.mrcai.controller;

import com.aaa.mrcai.annotion.AAALog;
import com.aaa.mrcai.pojo.vo.GoodsDepositVo;
import com.aaa.mrcai.query.GoodsDepositQuery;
import com.aaa.mrcai.result.AjaxResult;
import com.aaa.mrcai.service.GoodsDepositService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Demo class
 *
 * @Author: Wang
 * @Date: Created in 19:43 2021/12/6
 */
@RestController
@RequestMapping("goodsDeposit")
public class GoodsDepositController {
    @Autowired
    public GoodsDepositService goodsDepositService;

    @RequestMapping("list")
    public AjaxResult list(GoodsDepositQuery query){
        return goodsDepositService.list(query);
    }

    @RequestMapping("addGoodsDeposit")
    @AAALog("添加商品储藏方式")
    public AjaxResult addGoodsDeposit (GoodsDepositVo goodsDepositVo){
        return goodsDepositService.addGoodsDeposit(goodsDepositVo);
    }

    @RequestMapping("/getGoodsDeposit/{id}")
    public AjaxResult getGoodsDeposit (@PathVariable("id") int id ){
        return goodsDepositService.getGoodsDeposit(id);
    }

    @RequestMapping("updateGoodsDeposit")
    @AAALog("修改商品储藏方式")
    public AjaxResult updateGoodsDeposit (GoodsDepositVo goodsDepositVo){
        return goodsDepositService.updateGoodsDeposit(goodsDepositVo);
    }

    @RequestMapping("/deleteGoodsDeposit/{id}")
    @AAALog("删除商品储藏方式")
    public AjaxResult deleteGoodsDeposit (@PathVariable("id") int id ){ return goodsDepositService.deleteGoodsDeposit(id); }

}
